package zgs;

import java.util.*;

public class Main1 {
    public static void main(String[] args) {
        LinkedList<Double> list = new LinkedList<>();
        ss(list);
        double avg = aa(list);
        System.out.println("平均分为:"+avg);

    }
    public static void ss(LinkedList<Double> s){
        Scanner scan = new Scanner(System.in);
        for(int i=0;i<6;i++){
            System.out.println("请输入第"+(i+1)+"位评委的分数:");
            s.add(scan.nextDouble());
        }
    }

    public static double aa(LinkedList<Double> c){
        Collections.sort(c);
        c.removeFirst();
        c.removeLast();
        double sum =c.stream().reduce((o1,o2)->o1+o2).get();
        double avg =sum/4;
        return avg;
    }
}
